#include <iostream>
using namespace std;

int main()
{
    //数组的学习
    //1，数组类型  数据名[数组长度]
//数组元素的下标是从零开始索引的
    int arr [5];
    //给数组中的元素进行赋值
    arr[0] = 10;
    arr[1] = 20;
    arr[2] = 30;
    arr[3] = 40;
    arr[4] = 50;

    //访问数据元素
    cout<<arr[0]<<endl;
    cout<<arr[1]<<endl;
    cout<<arr[2]<<endl;
    cout<<arr[3]<<endl;
    cout<<arr[4]<<endl;





    //2，数组类型  数组名[数组长度] = {值1，值2....};

    int arr2[6] = {1,2,3,4,5,6};
    cout<<arr[0]<<endl;
    cout<<arr[1]<<endl;
    cout<<arr[2]<<endl;
    cout<<arr[3]<<endl;
    cout<<arr[4]<<endl;
    cout<<arr[5]<<endl;
    system("pause");
    return 0;
}
